/*package com.zxkj.logistics.controller;

import com.zxkj.logistics.mapper.UserMapper;
import com.zxkj.logistics.model.User;
import com.zxkj.logistics.util.Contants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import tk.mybatis.mapper.util.StringUtil;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

*//*@RequestMapping("/user")
@Controller
public class UserController {
    @Resource
    private HttpServletRequest request;
    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/login")
    @ResponseBody
    public boolean login(User user){
        boolean flag = false;
        if(StringUtil.isNotEmpty(user.getName())&&
                StringUtil.isNotEmpty(user.getPassword())){
            User usr = userMapper.selectOne(user);
            if(null != usr){
                flag = true;
                HttpSession session =request.getSession();
                if(session == null){
                    return false;
                }else{
                    session.setAttribute(Contants.SESSION_KEY,usr);
                }
            }
        }
        return flag;
    }

    @RequestMapping("/index")
    public String index(Model model){
        HttpSession session = request.getSession();
        if(session==null){
            return null;
        }else{
            model.addAttribute("user",session.getAttribute(Contants.SESSION_KEY));
        }
        model.addAttribute("userlist",userMapper.selectAll());
        return "hello/index";
    }*//*
}*/
